package wang.jingzhao.MDNotes;
import java.io.*;
import android.app.*;
import android.content.*;

public class doFile
{
	public doFile()
	{
		//nothing
	}
	public String[] listDir(File dir)
	{
		theApplication theapplication = (theApplication)theApplication.gettheApplication();
		
		String[] returnvar = null;
		File[] DirList = dir.listFiles();
		/* returnvar 定义
		[0]为状态码 定义见theApplication类
		[1]及其之后为文件夹列表 */
		
		if(null != DirList)
		{
			returnvar[0] = theapplication.DoFlleScanBack_OK;
			for(int i = 0;i < DirList.length;i++)
			{
				if(DirList[i].isDirectory())
				{
					returnvar[i+1] = DirList[i].getName();
				}
			}
		}
		else
		{
			returnvar[0] = theapplication.DoFlleScanBack_Erase;
		}
		
		return returnvar;
	}
}
